238

|

6 Applications and Methods in Biosignal Processing

local_minima_angle = value_angle';

local_minima_angle(value_angle > threshold_angle) = 0;

%segment seperated by 0 calculation

%find nonzero elements

angle_ne0 = find(local_minima_angle);

%find local minima start indices

angle_ixstart = angle_ne0(diff([0 angle_ne0])>1);

angle_ixend = angle_ne0([find(diff(angle_ne0)>1) length(angle_ne0)]);

%Plotting raw force and angle data with thresholds and

%start and end points of local minima

f2 = figure('Name','Synchronization');

subplot(6,1,1)

plot(time_force(1:601), value_force(1:601), 'k')

xlabel('Time t/s')

axis([0 10 260 500])

ylabel('Force F/N')

title('Raw Force data')

legend ('Force')

subplot(6,1,2)

plot(time_angle(1:271),value_angle(1:271), 'k')

xlabel('Time t/s')

ylabel('Angle \alpha/deg')

title('Raw Angle data')

legend ('Angle')

subplot(6,1,3)

plot(time_force(1:601), local_minima_force(1:601), ...

'k-')

hold on

plot(time_force(1:601), value_force(1:601), 'k:')

t_f(1:609,1) = threshold_force;

plot(time_force(1:601), t_f(1:601),'k--')

scatter(time_force(force_ixstart), ...

local_minima_force(force_ixstart), 100, ...

'kx')

scatter(time_force(force_ixend), local_minima_force(force_ixend), ...

100, ...

'ko')

xlabel('Time t/s')

axis([0 10 260 500])

ylabel('Force F/N')